home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / DTS.Draw / TreeObj2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.9 KB  |  98 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TreeObj2.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11.  
  12.  
  13. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  14. #include "App.Common.h"        /* Get the stuff in common with rez.            */
  15. #include "App.protos.h"        /* Get the prototypes for the application.        */
  16.  
  17. #ifndef __TREEOBJ2__
  18. #include "TreeObj2.h"
  19. #endif
  20.  
  21. extern TreeObjProcPtr    gTreeObjMethods[];
  22.  
  23.  
  24.  
  25. /**********************************************************************/
  26.  
  27.  
  28.  
  29. #pragma segment File
  30. TreeObjHndl    DoTreeHitTest(TreeObjHndl hndl, ClickInfo *click)
  31. {
  32.     short        cnum;
  33.     TreeObjHndl    hit;
  34.  
  35.     if (hit = (TreeObjHndl)DoTreeObjMethod(hndl, HITTESTMESSAGE, (long)click)) return(hit);
  36.  
  37.     for (cnum = 0; cnum < (*hndl)->numChildren; ++cnum)
  38.         if (hit = DoTreeHitTest(GetChildHndl(hndl, cnum), click)) return(hit);
  39.  
  40.     return(nil);
  41. }
  42.  
  43.  
  44.  
  45. /**********************************************************************/
  46.  
  47.  
  48.  
  49. #pragma segment File
  50. void    DoTreeDraw(TreeObjHndl hndl, short drawType)
  51. {
  52.     DoBTreeMethod(hndl, DRAWMESSAGE, drawType);
  53. }
  54.  
  55.  
  56.  
  57. /**********************************************************************/
  58.  
  59.  
  60.  
  61. #pragma segment File
  62. void    DoTreeSelect(TreeObjHndl hndl, short selectType)
  63. {
  64.     FileRecHndl    frHndl;
  65.     WindowPtr    window;
  66.  
  67.     frHndl = mDerefRoot(GetRootHndl(hndl))->frHndl;
  68.     BeginContent(window = (*frHndl)->fileState.window);
  69.     DoFTreeMethod(hndl, SETSELECTMESSAGE, selectType);
  70.     EndContent(window);
  71. }
  72.  
  73.  
  74.  
  75. /**********************************************************************/
  76.  
  77.  
  78.  
  79. #pragma segment File
  80. long    DoTreeObjMethodClipped(TreeObjHndl hndl, short message, long data)
  81. {
  82.     FileRecHndl    frHndl;
  83.     WindowPtr    window;
  84.     long        val;
  85.  
  86.     frHndl = mDerefRoot(GetRootHndl(hndl))->frHndl;
  87.     BeginContent(window = (*frHndl)->fileState.window);
  88.  
  89.     val = DoTreeObjMethod(hndl, message, data);
  90.  
  91.     EndContent(window);
  92.  
  93.     return(val);
  94. }
  95.  
  96.  
  97.  
  98.